/*
 * @Author: your name
 * @Date: 2021-01-15 10:42:31
 * @LastEditTime: 2021-01-15 11:58:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \carlist\src\store\reducers\detail.js
 */
import { GET_INFO_AND,GET_IMG_LIST,GET_YEAR_COLOR,GET_CATEGORY_LIST } from "../actionType";

let ininState = {
    infoList:[],
    imgList:[],
    colorList:[],
    categoryList:[]
}
let detail = (state=ininState,action)=>{
    let newstate = JSON.parse(JSON.stringify(state));
    switch (action.type) {
        case GET_INFO_AND:
            newstate.infoList = action.data
            break;
        case GET_IMG_LIST:
            newstate.imgList = action.data
            break;
        case GET_YEAR_COLOR:
            newstate.colorList = action.data
            break;     
        default:
            break;
    }
    return newstate
}

export default detail